Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove config key normalization #4742

Merged
merged 2 commits into from Apr 30, 2019
Merged

Conversation

jcrist
Copy link
Member

@jcrist jcrist commented Apr 26, 2019

Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).

We now keep the user-facing functions (e.g. get, set, etc...)
agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.

Supersedes #4422.
Fixes #4366.

Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).

We now keep the user-facing functions (e.g. ``get``, ``set``, etc...)
agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.
@mrocklin
Copy link
Member

cc @djhoese

djhoese pushed a commit to djhoese/donfig that referenced this pull request Apr 27, 2019
Original changes by @jcrist, adapted for donfig.
See dask/dask#4742 for details.
@jcrist
Copy link
Member Author

jcrist commented Apr 29, 2019

Planning on merging tomorrow if no comment.

dask/config.py Outdated
def canonical_name(k, config):
"""Return the canonical name for a key.

Handles user choose of '-' or '_' conventions by standardizing on whichever
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo choose -> choice

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

@jcrist
Copy link
Member Author

jcrist commented Apr 30, 2019

Merging.

@jcrist jcrist merged commit cd1acd6 into dask:master Apr 30, 2019
@jcrist jcrist deleted the config-canonicalization branch April 30, 2019 15:14
@djhoese
Copy link
Contributor

djhoese commented Apr 30, 2019

These changes have been ported to the donfig package and released as part of the 0.4.0 release (PyPI released, waiting on conda-forge).

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019
* Remove config key normalization

Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).

We now keep the user-facing functions (e.g. ``get``, ``set``, etc...)
agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.

* Type [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Key normalization when reading config breaks logging configuration of Distributed
4 participants